/**
 * 心灵树洞 - 样式表
 * 营造温暖、安全、友好的视觉体验
 */

/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', '微软雅黑', Tahoma, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px 0;
}

/* 主容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 页面头部 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.title {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.2em;
    color: #666;
    font-weight: 400;
    opacity: 0.9;
}

/* 隐私保护说明 */
.privacy-notice {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.3);
    position: relative;
    overflow: hidden;
}

.privacy-notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.3;
}

.notice-icon {
    font-size: 2.5em;
    flex-shrink: 0;
    z-index: 1;
}

.notice-content {
    flex: 1;
    z-index: 1;
}

.notice-content h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 600;
}

.notice-content p {
    font-size: 1em;
    line-height: 1.6;
    opacity: 0.95;
}

/* 表单样式 */
.message-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 35px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

/* 分类选择区域 */
.category-section {
    margin-bottom: 30px;
}

.category-section h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

.category-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.category-option {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
    position: relative;
    overflow: hidden;
}

.category-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.category-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.category-option:hover::before {
    left: 100%;
}

.category-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.category-label {
    font-size: 1em;
    font-weight: 500;
    color: #333;
    user-select: none;
}

.category-option:has(input:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.category-option:has(input:checked) .category-label {
    color: white;
}

/* 内容输入区域 */
.content-section {
    margin-bottom: 30px;
}

.content-section h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

#messageContent {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1em;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafbfc;
}

#messageContent:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#messageContent::placeholder {
    color: #999;
    opacity: 0.8;
}

.char-counter {
    text-align: right;
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

#charCount {
    font-weight: 600;
    color: #27ae60;
}

/* 提交按钮区域 */
.submit-section {
    text-align: center;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 200px;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:active {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 温馨提示区域 */
.tips-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.tips-section h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.tips-list {
    list-style: none;
}

.tips-list li {
    padding: 12px 0;
    padding-left: 30px;
    position: relative;
    color: #555;
    font-size: 1em;
    line-height: 1.5;
}

.tips-list li::before {
    content: '✨';
    position: absolute;
    left: 0;
    top: 12px;
    font-size: 1.2em;
}

.tips-list li:nth-child(even)::before {
    content: '🌟';
}

/* 页面底部 */
.footer {
    text-align: center;
    padding: 25px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.footer p {
    color: #666;
    font-size: 0.95em;
    margin: 0;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-content.error {
    border-left: 5px solid #e74c3c;
}

.modal-icon {
    font-size: 3em;
    margin-bottom: 20px;
}

.modal-content h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.modal-content p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px 0;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 30px 20px;
        margin-bottom: 25px;
    }
    
    .title {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1.1em;
    }
    
    .privacy-notice {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }
    
    .message-form {
        padding: 25px 20px;
    }
    
    .category-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .category-option {
        padding: 12px 15px;
    }
    
    #messageContent {
        min-height: 150px;
        padding: 15px;
    }
    
    .submit-btn {
        padding: 15px 30px;
        font-size: 1em;
        width: 100%;
    }
    
    .tips-section {
        padding: 20px;
    }
    
    .modal-content {
        padding: 30px 20px;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px 15px;
    }
    
    .title {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .message-form {
        padding: 20px 15px;
    }
    
    .privacy-notice {
        padding: 15px;
    }
    
    .tips-section {
        padding: 15px;
    }
    
    .modal-content {
        padding: 25px 15px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* 页面加载动画 */
.container > * {
    animation: fadeInUp 0.6s ease-out;
}

.container > *:nth-child(1) { animation-delay: 0.1s; }
.container > *:nth-child(2) { animation-delay: 0.2s; }
.container > *:nth-child(3) { animation-delay: 0.3s; }
.container > *:nth-child(4) { animation-delay: 0.4s; }
.container > *:nth-child(5) { animation-delay: 0.5s; }

/* 提交按钮脉冲效果 */
.submit-btn:focus {
    animation: pulse 2s infinite;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* 选择文本样式 */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: #333;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: #333;
}